# from math import floor
from math import floor


def findfalse(yingbi, start, n):
    if n == 1:
        return start
    nhalf = floor(n/2.0)
    print(yingbi[start:start+nhalf])
    print(yingbi[start+nhalf:start+nhalf+nhalf])
    wl = sum(yingbi[start:start+nhalf])
    wr = sum(yingbi[start+nhalf:start+nhalf+nhalf])
    print(wl, wr) 
    if wl < wr:
        findfalse(yingbi, start, nhalf)
    elif wr < wl:
        findfalse(yingbi, start+nhalf, nhalf)
    elif wl == wr:
        return start+n-1

# yingbi = [22, 22, 22, 22, 21, 22, 22, 22, 22, 22, 22]
# yingbi = [22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 21]
yingbi = [21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22]
r = findfalse(yingbi, 0, len(yingbi))
print(len(yingbi))
print(r)
# yingbi = [22, 22, 22, 22, 21, 22, 22, 22, 22, 22, 22]
# low=0
# high=len(yingbi)
# mid=(low+high)//2
# while low<high:
#     print(yingbi[low:mid])
#     print(yingbi[mid:high])
#     leftsum=sum(yingbi[low:mid])
#     rightsum=sum(yingbi[mid:high])
#     if leftsum<rightsum:
#         high=mid
#     elif leftsum>rightsum:
#         low=mid
#     mid=(low+high)//2